package com.itheima.permission;

public class Student {
    private int age;

    // set,get方法
    public void setage(int age){
        if(age>=1 && age<=120){
            this.age=age;
        }else{
            System.out.println("年龄有误");
        }
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getAge(){
        return age;
    }

    // 构造方法
    public Student() {
    }
    public Student(int age) {
        this.age = age;
    }



}
